<?php

namespace App\Admin\Http\Requests;

class NavigationRequest extends Request
{

    /**
     * 用户请求授权
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * 配置验证规则
     *
     * @return array
     */
    public function rules()
    {

        return [
            'name' => 'required|max:50',
            'link' => 'required|max:100',
            'description' => 'max:100',
            'sort' => "required|integer"
        ];
    }

    /**
     * 验证的属性
     *
     * @return array
     */
    public function attributes()
    {
        return [
            'name' => '名称',
            'link' => 'URL链接',
            'description' => '描述',
            'sort' => '排序'
        ];
    }
}